Physics 3180: Thermal Physics
Computational Aid:
Computer
Problems in "An Introduction to Thermal Physics"by Daniel V. Schroeder
(Addison Wesley Longman, 1999)
In Mathematica: The basic plotting function is Plot[ ], and the syntax is:
Plot[Exp[-x^2],{x,-3,3}]
This instruction generates a plot of the Gaussian function exp(-x2) for values
of x ranging from -3 to 3.
Note that all Mathematica functions are case-sensitive, and that built-in functions such as Plot and Exp always start with capital letters. There are an enormous number of variations on the basic Plot function, which you can learn by reading Section 1.9 of The Mathematica Book.
Numerical Calculations: Before performing a numerical calculation it's
usually a good idea to plot the relevant function(s) and estimate the
answer graphically.
Otherwise it's much too easy to get a wrong answer and not realize it.
Many scientific calculators can handle numerical integrals and root finding;
just be sure to write down exactly what you punched into the calculator,
in case you need to check for errors later.
Numerical calculations in Mathematica: are easy.
The numerical integration function is NIntegrate; here is an example:
NIntegrate[x^2*Exp[-x^2],{x,0,.5}]
The syntax is exactly the same as for the Plot function, with the
list in curly braces specifying the integration variable and the
beginning
and ending values.
Root Finding: To solve a transcendental equation, use the FindRoot
function:
FindRoot[Tanh[x]==x/2,{x,1.5}]
Note the double = sign in the equation to solve. The number 1.5
tells Mathematica where to start looking for a solution (since
there may be
more than one);
in this case the function returned 1.91501.
The Texbook Author's WEB-site: http://physics.weber.edu/thermal/computer.html